package com.elastic.chain;

import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;

/**
 * @ClassName Adaptee
 * @Author xiezhuocai
 * @Description 定义一些查询语句,带完成
 * @Date 2021/12/28 17:44
 */
public class MustAdaptee {


    /**
     * @ClassName Adaptee
     * @Author xiezhuocai
     * @Description 模糊查询
     * @Date 2021/12/28 17:44
     */
    public void wildcardQuery(BoolQueryBuilder boolQuery, String key, Object value){
        boolQuery.must(QueryBuilders.wildcardQuery(key, ("*" + value + "*")));
    }

}
